package cn.edu.ren.controller;

import cn.edu.ren.feign.IStudentFeign;
import cn.edu.ren.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

/**
 * 数据服务监测路径：http://localhost:8016/actuator/hystrix.stream
 * 数据可视化服务监测路径：http://localhost:8016/hystrix
 */
@RestController
@RequestMapping("/hystrix")
public class HystrixController {

    @Autowired
    private IStudentFeign studentFeign;

    @GetMapping("/find_all")
    public Collection<Student> findAll(){
        return studentFeign.findAll();
    }

    @GetMapping("/index")
    public String index(){
        return studentFeign.index();
    }

}
